\documentclass{article}
 
\usepackage[pdftex,active,tightpage]{preview}
\usepackage{tikz}
\usetikzlibrary{snakes}
\usetikzlibrary{arrows}
\makeatletter
 
\begin{document}
\begin{preview}
	%%
	\begin{tikzpicture}[scale=0.35]
	
	%% Now Draw the octree ...
		
	  \draw [help lines]
	 			 [step = 2cm]       (0,0) grid (8,8)
	 			 [step = 1cm]       (0,0) grid (6,6)
	 			 [step = 1cm] 			(6,2) grid +(2,2)
	 			 ;
	   
	   \draw [help lines] 
	   				[step=0.5cm] (4,0) grid +(2,2)
	   				[step=0.5cm] (4,4) grid +(2,2)
	   				[step=0.5cm] (1,4) grid +(2,2)
	   				[step=0.5cm] (5,2) grid +(2,2)
	   				[step=0.5cm] (2,2) grid +(2,2)
	   				[step=0.25cm] (4,0.5) grid +(1.5,1.5)
	   				[step=0.5cm] (1,1) grid +(2,2)
	   				[step = 0.5cm] 			(2,6) grid +(2,2)
	 			 		[step = 0.5cm] 			(6,6) grid +(2,2)
	 			 		[step=0.25cm] (2.5,6) grid +(1.5,1.5)
	 			 		[step=0.25cm] (6,6.5) grid +(1.5,1.5)		
	 			 		
	 			 		[step=0.25cm] (1.5,1.5) grid +(0.5,1.0)
	 			 		[step=0.25cm] (2.5,1.5) grid +(0.5,1.0)		
	 			 		[step=0.25cm] (2,2.5) grid +(1.5,0.5)
	 			 		[step=0.25cm] (2,3.5) grid +(1.5,0.5)
	 			 		[step=0.25cm] (2,3) grid +(0.5,0.5)
	 			 		[step=0.25cm] (3,3) grid +(0.5,0.5)
	 			 		
	 			 		[step=0.25cm] (5.5, 2.5) grid +(0.5,1.0)
	 			 		[step=0.25cm] (6.5, 2.5) grid +(0.5,1.0)
	 			 		[step=0.25cm] (4, 4.5) grid +(0.5,1.0)
	 			 		[step=0.25cm] (5, 4.5) grid +(0.5,1.0)
	 			 		[step=0.25cm] (1.5, 4) grid +(1.0,0.5)
	 			 		[step=0.25cm] (1.5, 5) grid +(1.0,0.5)
	   				;		 
	   		 
	%% The scene	
	% draw background ...
	    \filldraw[fill=green, fill opacity=0.3] (0,0) rectangle +(8,8);
	 
	 		% draw first set of boxes ... red 
	 		\filldraw[fill=red, fill opacity=0.3] (2.25,2.75) rectangle +(1,1);
	 		\filldraw[fill=red, fill opacity=0.3] (2.75,6.25) rectangle +(1,1);
	 		\filldraw[fill=red, fill opacity=0.3] (5.75,2.5) rectangle +(1,1);
	 		\filldraw[fill=red, fill opacity=0.3] (6.25,6.75) rectangle +(1,1);
	 		
	 		
	 		% draw first set of boxes ... red 
	 		\filldraw	[fill=blue, fill opacity=0.3] (1.75,1.5) rectangle +(1,1);
	 		\filldraw	[fill=blue, fill opacity=0.3] (1.5,4.25) rectangle +(1,1);
	 		\filldraw	[fill=blue, fill opacity=0.3] (4.25,0.75) rectangle +(1,1);
	 		\filldraw	[fill=blue, fill opacity=0.3] (4.25,4.5) rectangle +(1,1);
	 		
	 	%% The histogram ,,,
		%% red = 55, blue = 46, green = 197, total = 298
		\filldraw[fill=red, fill opacity=0.3] (0.5,-2) rectangle +(0.6,0.37);
		\filldraw[fill=blue, fill opacity=0.3] (1.5,-2) rectangle +(0.6,0.31);
		\filldraw[fill=green, fill opacity=0.3] (2.5,-2) rectangle +(0.6,1.32);
		
		\draw [->] (0,-2) -- (4,-2);
		\draw [->] (0,-2) -- (0,-0.2);
		
		\node at (6,-1) {$\textsc{H = 0.87}$};
	\end{tikzpicture}%%
\end{preview}
\end{document}